﻿public class Singleton<T> where T : new()
{
    private static T instance;
    private static object lockObject = new object();
    public static T Instance
    {
        get
        {
            lock(lockObject)
            {
                if(instance == null)
                {
                    instance = new T();
                }
                return instance;
            }
        }
    }
}
